import { useEffect, useState } from "react"

export default function App() {
    const [count, setCount] = useState(0)
    const [msg] = useState('hello react')
    useEffect(() => {
        console.log(count);
    },[count])
    useEffect(() => {
    console.log(msg);
    },[msg])
    const handleClick = () => {
        setCount(count + 1)
    }
    return (
        <>
            <h1>useEffect</h1>
            <button onClick={handleClick}>   </button>
            <br />
            {count}{msg}
        </>
    )
}